package mylibrary.outofmemory;
/**
 * VM Args：-Xss128k
 * @author gaoshuai
 *
 */

public class JavaVMStackSOF {

	private int stackLength = 1;
	public void stackLeak() {
		stackLength++;
		stackLeak();
	}
	
	public static void main(String[] args) throws Throwable {
		
		JavaVMStackSOF OOM = new JavaVMStackSOF();
		
		try {
			OOM.stackLeak();
		} catch (Throwable e) {
			System.out.println("Stack length:" + OOM.stackLength);
			throw e;	
		}
		
	}
}
